package com.yydm.serviceedu.controller;

import com.yydm.commonutils.R;
import com.yydm.servicebase.exceptionhandler.LException;
import com.yydm.serviceedu.client.VodClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Classname VodController
 * @Description TODO
 * @Version 1.0.0
 * @Date 2022/6/30 15:40
 * @Created by liu25
 */
@RestController
@RequestMapping("/vod")
public class DeleteVodController {

    @Autowired
    private VodClient vodClient;

    @DeleteMapping("/deletevod/{videoId}")
    public void deletevod(@PathVariable("videoId") String videoId) {

        R result = vodClient.removeVideo(videoId);

        if (result.getCode() == 500) {
            throw new LException(500, "删除视频失败");
        }

    }

    @GetMapping("/addtest")
    public String addtest() {
        return "asdffda";
    }


}
